package com.spdb.oa.type;

/**
 * For GetXXList User type
 * @author lij70
 *
 */
public class User {
	
	public static String SELF = "0";
	public static String DELEGATE = "1";
	public static String AGENT = "2";
	
	@Override
	public String toString() {
		return "User [userType=" + userType + ", userAccount=" + userAccount + ", userName=" + userName + ", count="
				+ count + "]";
	}
	public String userType;
	public String userAccount;
	public String userName;
	public int count;
	public User(String userType, String userAccount, String userName, int count) {
		super();
		this.userType = userType;
		this.userAccount = userAccount;
		this.userName = userName;
		this.count = count;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + count;
		result = prime * result + ((userAccount == null) ? 0 : userAccount.hashCode());
		result = prime * result + ((userName == null) ? 0 : userName.hashCode());
		result = prime * result + ((userType == null) ? 0 : userType.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		if (count != other.count)
			return false;
		if (userAccount == null) {
			if (other.userAccount != null)
				return false;
		} else if (!userAccount.equals(other.userAccount))
			return false;
		if (userName == null) {
			if (other.userName != null)
				return false;
		} else if (!userName.equals(other.userName))
			return false;
		if (userType != other.userType)
			return false;
		return true;
	}
	
	
}
